#include <QDebug>
#include <QWidget>
#include "DrawCommand.h"

DrawCommand::DrawCommand(QWidget *pWdt, QList<IShape*> *listShape, IShape *pShape)
	: m_pTargetWidget(pWdt), m_pListShape(listShape), m_pShape(pShape) {}

void DrawCommand::undo()
{
	m_pListShape->removeOne(m_pShape);
	m_pTargetWidget->update();
}

void DrawCommand::redo()
{
	m_pListShape->append(m_pShape);
	m_pTargetWidget->update();
}
